package main

type predicateInt func(int) bool

func IsEven(value int) bool {
	return value%2 == 0
}

func Filter(slice []int, predicate predicateInt) []int {
	var result []int
	for _, value := range slice {
		if predicate(value) {
			result = append(result, value)
		}
	}
	return result
}
